I'm implementing a program that needs to use a function from another module that has 3 parameters:

Header from the function I need to use:

Code:
int create_torrent_from_metainfo_file (char const * const metainfo_file_name, struct torrent_t * const torrent,
        char const * const downloaded_file_name);
Main:
Code:
int main(int argc, char **argv) {
struct torrent_t torrent;
    if(argc == 2) {
        if(create_torrent_from_metainfo_file(argv[1], &torrent, downloaded_file_name) {
....
        }
}


Given that when I'll run the program I'll pass as an argument a metainfo file (which is a .ttorrent file), I need the 3rd parameter in the function to be the name of this metainfo file without the .ttorrent extension (the name of argv[1] without the extension), but I'm very lost and I don't know how to do it.

Any idea?

Thank you in advance.